﻿# encode=utf-8

import os, sys, time
import win32com
from win32com.client import Dispatch, constants
time.clock()

docfile = sys.argv[1]
txtfile = sys.argv[2]
print(docfile)
w = win32com.client.Dispatch('Word.Application')  
w.Visible = 0  
w.DisplayAlerts = 0  
doc = w.Documents.Open( os.path.abspath(docfile) )  
doc.SaveAs( os.path.abspath(txtfile), 2 )
doc.Close()
w.Quit()

